#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
typedef long long LL;
const LL MAXN=1e5+7;
const LL MOD=1e9+7;
LL a[MAXN];
LL _xor[MAXN];
int main() {
	LL n,l,r;
	scanf("%lld%lld%lld", &n, &l, &r);
	if (l==r && l%2) {
		printf("0\n");
		return 0;
	}
	l=2*((l+1)/2);
	r=2*(r/2);
	for (LL i=1; i<=n; ++i) scanf("%lld", a+i);
	a[0]=0;
	LL res=0;
	LL dp[2][2]; 
	for (LL i=0, mark=1, t; i<32; ++i, mark=(mark<<1)) {
		t=0;
		_xor[0]=0;
		memset(dp, 0, sizeof(dp));
		for (LL j=1; j<=n; ++j) {
			_xor[j]=_xor[j-1]^((bool)(a[j]&mark));
		}
		for (LL j=l-1; j<=n; ++j) {
			if (j-l>=0) ++dp[(j-l)&1][_xor[j-l]^1];
			t=t+dp[j&1][_xor[j]];
			if (j-r>=0) --dp[(j-r)&1][_xor[j-r]^1];
		}
//		cout<<"t: "<<t<<endl;
		t=t%MOD;
		res=(res+t*mark%MOD)%MOD;
	}
	printf("%lld\n", res); 
	return 0;
} 
